﻿using System;

namespace Reactor.Messaging
{
    public interface ISubscriptionDataProvider
    {
        /// <summary>
        /// Obtains all data necessary to construct and return all Subscribers.
        /// </summary>
        /// <returns>Array of <see cref="Subscriber"/>s</returns>
        Subscriber[] GetAllSubscribers();

        /// <summary>
        /// Obtains all data necessary to construct and return a <see cref="Subscriber"/>. Looks 
        /// the subscription record up by the subscriber's name.
        /// </summary>
        /// <param name="subscriberName">Name of the subscriber.</param>
        /// <returns><see cref="Subscriber"/> instance</returns>
        Subscriber GetSubscriberByName(string subscriberName);

        /// <summary>
        /// Saves the provided subscriber instance.
        /// </summary>
        /// <param name="subscriber">The subscriber to be saved.</param>
        /// <exception cref="ArgumentNullException">Throws an ArgumentNullException if the <paramref name="subscriber"/> parameter is null.</exception>
        void SaveSubscriber(Subscriber subscriber);
    }
}
